home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Selection / Multimedia Selection Volume One - CD-ROM / MULTIMEDIA SELECTION____________.ISO / utils / dwprog11 / init.bat < prev    next >
Encoding:
DOS Batch File  |  1993-08-07  |  2.8 KB  |  132 lines

  1. @echo off
  2. goto SetVars
  3. :: //////////////////////////////////////////
  4. :: /             Init.Bat                   /
  5. :: / author: w.burlew.                      /
  6. :: / NOTE: change environment vars          /
  7. :: /       [SDRV=?] [TDRV=?] & [DWDIR=?]    /
  8. :: /       if defaults are not suitable.    /
  9. :: //////////////////////////////////////////
  10.  
  11. :SetVars
  12. set SDRV=A:
  13. set TDRV=C:
  14. set DWDIR=DW
  15. goto begin
  16.  
  17. ::======Invalid keypress
  18. :BadKey
  19. cls
  20. echo   Please press the 'Y' or 'N' key!
  21. echo.
  22. pause
  23. goto begin
  24.  
  25. ::======Start Batch
  26. :begin
  27. cls
  28. echo      *   *   *   DWProgs Installation & Print Documents Batch  *   *   *
  29. echo.
  30. echo   Ensure your printer is on to print the documents.
  31. echo   Print Documents? (Y/N)
  32. bw
  33. if NOT errorlevel 90 if errorlevel 89 goto PrnYes
  34. if NOT errorlevel 79 if errorlevel 78 goto PrnNo
  35. goto BadKey
  36.  
  37. ::======Print documents
  38. :PrnYes
  39. if NOT exist descrier.txt goto FErr
  40. echo   Printing Descrier.Txt   Please wait...
  41. type descrier.txt > prn
  42. if NOT exist register.frm goto FErr
  43. echo   Printing Register.Frm   Please wait...
  44. type register.frm > prn
  45. echo.
  46. echo   Printing task completed.
  47. goto PrnNo
  48.  
  49. ::======Prompt to install to hardrive
  50. :PrnNo
  51. echo.
  52. echo   Installing these programs to your hard-drive is recommended.
  53. echo   Ensure your [path] contains   %tdrv%\%dwdir%;
  54. echo   or whatever directory you placed the programs in.
  55. echo.
  56. echo   Install to Hard-Drive? (Y/N)
  57. bw
  58. if NOT errorlevel 90 if errorlevel 89 goto InstYes
  59. if NOT errorlevel 79 if errorlevel 78 goto InstNo
  60. goto BadKey
  61.  
  62. ::======Install the file(s)
  63. :InstYes
  64. echo   Installing to %tdrv%\%dwdir%   Please wait...
  65. echo.
  66. if exist %tdrv%\%dwdir%\NUL goto DirExists
  67. md %tdrv%\%dwdir%
  68. goto DoCopy
  69.  
  70. ::=====Actual copy process
  71. :DoCopy
  72. dwcopy %sdrv%\*.* %tdrv%\%dwdir% /v
  73. %tdrv%
  74. cd\%dwdir%
  75. if exist init.bat del init.bat
  76. if exist bw.com del bw.com
  77. echo.
  78. echo   Installation completed!
  79. echo.
  80. pause
  81. cls
  82. dir
  83. echo.
  84. echo   Type one of the above executable program's name then press [enter]
  85. echo   to execute any one of the program(s)...
  86. echo.
  87. goto fini
  88.  
  89. ::=====Old DW dir found
  90. :DirExists
  91. echo   %tdrv%\%dwdir% directory already exists.
  92. if exist %tdrv%\%dwdir%\*.* goto ProgsFound
  93. goto DoCopy
  94.  
  95. ::=====Directory has files so move 'em
  96. :ProgsFound
  97. echo   Moving old files to %tdrv%\OLDDW
  98. md %tdrv%\OLDDW
  99. dwmove %tdrv%\%dwdir%\*.* %tdrv%\OLDDW /v
  100. goto DoCopy
  101.  
  102. ::======File(s) not found
  103. :FErr
  104. cls
  105. echo.  [File Error]
  106. echo.
  107. echo   Could not find all the "DW" program files...
  108. echo   The "DW" program(s) must all be in the same directory.
  109. echo   %0 terminating.
  110. echo.
  111. goto end
  112.  
  113. ::======No install
  114. :InstNo
  115. echo.
  116. echo   Batch terminated!
  117. goto ClrEnv
  118.  
  119. ::======Hasta la vista
  120. :fini
  121. echo   %0 process completed!
  122. goto ClrEnv
  123.  
  124. ::======Clear environment
  125. :ClrEnv
  126. set SDRV=
  127. set TDRV=
  128. set DWDIR=
  129. goto end
  130.  
  131. :end
  132.